/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * Mal_Girişi.java
 *
 * Created on May 26, 2011, 8:38:29 PM
 */
package dinamikendirimsistemi;

import java.awt.HeadlessException;
import java.io.IOException;
import java.sql.ResultSet;
import java.sql.SQLException;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;

/**
 *
 * @author Hidayet
 */
public class Mal_Girişi extends javax.swing.JFrame {

    /** Creates new form Mal_Girişi */
    public Mal_Girişi() {
        initComponents();
    }
    DatabaseConnection connect = new DatabaseConnection();

    private void NotFound(DefaultTableModel model) throws HeadlessException {
        JOptionPane.showMessageDialog(this, "Bazada bu adda mal yoxdur");
        table1.removeRowSelectionInterval(0, model.getRowCount() - 1);
        cleartxtboxes();
    }

    private void SearchForName(DefaultTableModel model, String malad) throws HeadlessException {
        boolean find = false;
        int num = 0;
        int firstindex = 0;
        for (int i = 0; i < model.getRowCount(); i++) {
            if (!find && model.getValueAt(i, 1).toString().equals(malad)) {
                find = true;
                firstindex = i;
                num++;
            } else if (find && model.getValueAt(i, 1).toString().equals(malad)) {
                num++;
            } else if (find && !model.getValueAt(i, 1).toString().equals(malad)) {
                JOptionPane.showMessageDialog(this, "Bazada bu adda " + num + " növ mal var!");
                table1.removeRowSelectionInterval(0, model.getRowCount() - 1);
                table1.addRowSelectionInterval(firstindex, firstindex);
                rowclick();
                break;
            }
            if (i == model.getRowCount() - 1 && num > 0) {
                JOptionPane.showMessageDialog(this, "Bazada bu adda " + num + " növ mal var!");
                table1.removeRowSelectionInterval(0, model.getRowCount() - 1);
                table1.addRowSelectionInterval(firstindex, firstindex);
                rowclick();
            }
        }
        if (!find) {
            NotFound(model);
        }
    }

    private void SearchForNameAndModel(DefaultTableModel model, String malad, String malmodel) throws HeadlessException {
        boolean find=false;
        for (int i = 0; i < model.getRowCount(); i++) {
            if (model.getValueAt(i, 1).toString().equals(malad) && model.getValueAt(i, 2).toString().equals(malmodel)) {
                find = true;
                table1.removeRowSelectionInterval(0, model.getRowCount() - 1);
                table1.addRowSelectionInterval(i, i);
                rowclick();
                break;
            }
        }
        if (!find) {
            NotFound(model);
        }

    }

    private void cleartxtboxes() {
        txt1.setText("");
        txt2.setText("");
        txt3.setText("");
        txt4.setText("");
        txt5.setText("");
    }

    private void goster() throws SQLException {
        try {
            DefaultTableModel model = (DefaultTableModel) table1.getModel();
            while (model.getRowCount() > 0) {
                model.removeRow(0);
            }
            String command = "Select * from product_input ORDER BY PRODUCT_NAME,PRODUCT_MODEL ASC";
            ResultSet rs = connect.ExecuteQuery(command);
            while (rs.next()) {
                String id = Integer.toString(rs.getInt("idPRODUCT_INPUT"));
                String ad = rs.getString("PRODUCT_NAME");
                String malmodel = rs.getString("PRODUCT_MODEL");
                String say = Integer.toString(rs.getInt("PRODUCT_AMOUNT"));
                String alisqiy = Double.toString(rs.getDouble("PRODUCT_PURCHASE_COST"));
                String satisqiy = Double.toString(rs.getDouble("PRODUCT_SALE_COST"));
                Object[] setir = new Object[]{id, ad, malmodel, say, alisqiy, satisqiy};
                model.addRow(setir);
            }
        } catch (IOException ex) {
            JOptionPane.showMessageDialog(null,
                    "Baza ilə bağlı problem var! \nXəta mesajı = " + ex.getMessage(),
                    "XƏTA", JOptionPane.ERROR_MESSAGE);
        }
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane2 = new javax.swing.JScrollPane();
        jTable2 = new javax.swing.JTable();
        pnlsearch = new javax.swing.JPanel();
        lbsearchad = new javax.swing.JLabel();
        txtsearchad = new javax.swing.JTextField();
        lblsearchmodel = new javax.swing.JLabel();
        txtsearchmodel = new javax.swing.JTextField();
        btnaxtarış = new javax.swing.JButton();
        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        txt1 = new javax.swing.JTextField();
        txt2 = new javax.swing.JTextField();
        txt3 = new javax.swing.JTextField();
        txt4 = new javax.swing.JTextField();
        txt5 = new javax.swing.JTextField();
        jPanel2 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        table1 = new javax.swing.JTable();
        jPanel3 = new javax.swing.JPanel();
        btnshow = new javax.swing.JButton();
        btnsave = new javax.swing.JButton();
        btnupdate = new javax.swing.JButton();
        btndelete = new javax.swing.JButton();

        jTable2.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jScrollPane2.setViewportView(jTable2);

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setAlwaysOnTop(true);
        setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        pnlsearch.setBorder(javax.swing.BorderFactory.createTitledBorder("mal axtarış"));
        pnlsearch.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        pnlsearch.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        lbsearchad.setFont(new java.awt.Font("Tahoma", 0, 12));
        lbsearchad.setText("malın adı");
        pnlsearch.add(lbsearchad, new org.netbeans.lib.awtextra.AbsoluteConstraints(65, 22, 59, -1));
        pnlsearch.add(txtsearchad, new org.netbeans.lib.awtextra.AbsoluteConstraints(128, 20, 210, -1));

        lblsearchmodel.setFont(new java.awt.Font("Tahoma", 0, 12));
        lblsearchmodel.setText("malın modeli");
        pnlsearch.add(lblsearchmodel, new org.netbeans.lib.awtextra.AbsoluteConstraints(356, 22, -1, -1));

        txtsearchmodel.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtsearchmodelActionPerformed(evt);
            }
        });
        pnlsearch.add(txtsearchmodel, new org.netbeans.lib.awtextra.AbsoluteConstraints(440, 20, 211, -1));

        btnaxtarış.setFont(new java.awt.Font("Tahoma", 0, 10)); // NOI18N
        btnaxtarış.setIcon(new javax.swing.ImageIcon("C:\\Users\\Hidayet\\Desktop\\dinamik endirim sistemi\\search_icon.gif")); // NOI18N
        btnaxtarış.setText("axtar");
        btnaxtarış.setSelectedIcon(new javax.swing.ImageIcon("C:\\Users\\Hidayet\\Desktop\\Image002.jpg")); // NOI18N
        btnaxtarış.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnaxtarışActionPerformed(evt);
            }
        });
        pnlsearch.add(btnaxtarış, new org.netbeans.lib.awtextra.AbsoluteConstraints(670, 20, 60, 20));

        getContentPane().add(pnlsearch, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 11, 740, 50));

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("mal məlumat"));
        jPanel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jLabel1.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabel1.setText("malın adı");
        jPanel1.add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(16, 42, -1, -1));

        jLabel2.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabel2.setText("malın modeli");
        jPanel1.add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(16, 80, -1, -1));

        jLabel3.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabel3.setText("malın sayı");
        jPanel1.add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(16, 118, -1, -1));

        jLabel4.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabel4.setText("malın alış qiyməti");
        jPanel1.add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(16, 159, -1, -1));

        jLabel5.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabel5.setText("malın satış qiyməti");
        jPanel1.add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(16, 194, -1, -1));

        txt1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txt1ActionPerformed(evt);
            }
        });
        jPanel1.add(txt1, new org.netbeans.lib.awtextra.AbsoluteConstraints(164, 40, 430, -1));
        jPanel1.add(txt2, new org.netbeans.lib.awtextra.AbsoluteConstraints(164, 78, 430, -1));
        jPanel1.add(txt3, new org.netbeans.lib.awtextra.AbsoluteConstraints(164, 116, 430, -1));
        jPanel1.add(txt4, new org.netbeans.lib.awtextra.AbsoluteConstraints(164, 154, 430, -1));
        jPanel1.add(txt5, new org.netbeans.lib.awtextra.AbsoluteConstraints(164, 192, 430, -1));

        getContentPane().add(jPanel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 81, 600, 240));

        jPanel2.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel2.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        table1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null}
            },
            new String [] {
                "mal_id", "mal_ad", "mal_model", "mal_say", "mal_aliş_qiyməti", "mal_satış_qiyməti"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }
        });
        table1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                table1MouseClicked(evt);
            }
        });
        table1.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                table1PropertyChange(evt);
            }
        });
        table1.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                table1KeyPressed(evt);
            }
            public void keyReleased(java.awt.event.KeyEvent evt) {
                table1KeyReleased(evt);
            }
        });
        jScrollPane1.setViewportView(table1);
        table1.getColumnModel().getSelectionModel().setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);

        jPanel2.add(jScrollPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 10, 716, 197));

        getContentPane().add(jPanel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 340, 740, 220));

        jPanel3.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel3.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        btnshow.setFont(new java.awt.Font("Tahoma", 0, 9)); // NOI18N
        btnshow.setIcon(new javax.swing.ImageIcon("C:\\Users\\Hidayet\\Desktop\\dinamik endirim sistemi\\VS2008ImageLibrary\\Actions\\pngformat\\TableHS.png")); // NOI18N
        btnshow.setText("Göstər");
        btnshow.setMaximumSize(new java.awt.Dimension(77, 25));
        btnshow.setMinimumSize(new java.awt.Dimension(77, 25));
        btnshow.setPreferredSize(new java.awt.Dimension(77, 25));
        btnshow.setSelectedIcon(new javax.swing.ImageIcon("C:\\Users\\Hidayet\\Desktop\\Image002.jpg")); // NOI18N
        btnshow.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnshowActionPerformed(evt);
            }
        });
        jPanel3.add(btnshow, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 30, 69, 31));

        btnsave.setFont(new java.awt.Font("Tahoma", 0, 9)); // NOI18N
        btnsave.setIcon(new javax.swing.ImageIcon("D:\\Computer Engineering\\uyumsoft\\icons\\save_icon.gif")); // NOI18N
        btnsave.setText("Əlavə Et");
        btnsave.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnsaveActionPerformed(evt);
            }
        });
        jPanel3.add(btnsave, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 90, 70, 30));

        btnupdate.setFont(new java.awt.Font("Tahoma", 0, 9)); // NOI18N
        btnupdate.setIcon(new javax.swing.ImageIcon("C:\\Users\\Hidayet\\Desktop\\dinamik endirim sistemi\\VS2008ImageLibrary\\Actions\\pngformat\\RepeatHS.png")); // NOI18N
        btnupdate.setText("Dəyiş");
        btnupdate.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnupdateActionPerformed(evt);
            }
        });
        jPanel3.add(btnupdate, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 140, 69, 31));

        btndelete.setFont(new java.awt.Font("Tahoma", 0, 9)); // NOI18N
        btndelete.setIcon(new javax.swing.ImageIcon("C:\\Users\\Hidayet\\Desktop\\dinamik endirim sistemi\\delete_icon.gif")); // NOI18N
        btndelete.setText("Sil");
        btndelete.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btndeleteActionPerformed(evt);
            }
        });
        jPanel3.add(btndelete, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 190, 69, 31));

        getContentPane().add(jPanel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(650, 90, 100, 230));

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void rowclick() {

        DefaultTableModel model = (DefaultTableModel) table1.getModel();
        int index = table1.getSelectedRow();
        txt1.setText(model.getValueAt(index, 1).toString());
        txt2.setText(model.getValueAt(index, 2).toString());
        txt3.setText(model.getValueAt(index, 3).toString());
        txt4.setText(model.getValueAt(index, 4).toString());
        txt5.setText(model.getValueAt(index, 5).toString());
    }

    private void txtsearchmodelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtsearchmodelActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtsearchmodelActionPerformed

    private void txt1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txt1ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txt1ActionPerformed

    private void btnshowActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnshowActionPerformed
        try {
            goster();
        } catch (SQLException ex) {
            JOptionPane.showMessageDialog(null,
                    "Baza ilə bağlı problem var! \nXəta mesajı = " + ex.getMessage(),
                    "XƏTA", JOptionPane.ERROR_MESSAGE);
        }

    }//GEN-LAST:event_btnshowActionPerformed

    private void table1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_table1MouseClicked
        rowclick();


    }//GEN-LAST:event_table1MouseClicked

    private void table1PropertyChange(java.beans.PropertyChangeEvent evt) {//GEN-FIRST:event_table1PropertyChange
        // TODO add your handling code here:
    }//GEN-LAST:event_table1PropertyChange

    private void table1KeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_table1KeyPressed
    }//GEN-LAST:event_table1KeyPressed

    private void table1KeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_table1KeyReleased
        rowclick();
    }//GEN-LAST:event_table1KeyReleased

    private void btnsaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnsaveActionPerformed

        String ad = txt1.getText();
        String model = txt2.getText();
        int amount = Integer.parseInt(txt3.getText());
        double purcost = Double.parseDouble(txt4.getText());
        double salescost = Double.parseDouble(txt5.getText());

        try {
            String message1 = "Məlumat əlavə olunsun?";
            int ret = JOptionPane.showConfirmDialog(this, message1, "Birini seçin", JOptionPane.YES_NO_OPTION);
            if (ret != 1) {
                String command = "INSERT INTO product_input (PRODUCT_NAME,PRODUCT_MODEL,PRODUCT_AMOUNT,PRODUCT_PURCHASE_COST,"
                        + "PRODUCT_SALE_COST) VALUES('" + ad + "','" + model + "','" + amount + "','" + purcost + "','" + salescost + "')";
                connect.Execute(command);
                JOptionPane.showMessageDialog(this, "Məlumat əlavə olundu");
                goster();
            } else {
                JOptionPane.showMessageDialog(this, "Məlumat əlavə olunmadı!");
            }
        } catch (Exception ex) {
            JOptionPane.showMessageDialog(this, "Məlumat əlavə olunmadı!\n" + "Xəta mesajı = " + ex.getMessage());
        }


    }//GEN-LAST:event_btnsaveActionPerformed

    private void btndeleteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btndeleteActionPerformed

        int selindex = table1.getSelectedRow();
        if (selindex >= 0) {
            DefaultTableModel model = (DefaultTableModel) table1.getModel();
            int selectedid = Integer.parseInt(model.getValueAt(selindex, 0).toString());
            try {
                String message1 = "Silmək istədiyinizdən əminsinizmi?";
                int ret = JOptionPane.showConfirmDialog(this, message1, "Birini seçin", JOptionPane.YES_NO_OPTION);
                if (ret != 1) {

                    String command = "Delete from product_input where idPRODUCT_INPUT='" + selectedid + "'";
                    connect.Execute(command);
                    JOptionPane.showMessageDialog(this, "Məlumat silindi");
                    goster();
                } else {
                    JOptionPane.showMessageDialog(this, "Məlumat silinmədi");
                }
            } catch (Exception ex) {
                JOptionPane.showMessageDialog(this, "Məlumat silinmədi" + "Xəta\n" + ex.getMessage());
            }
        } else {
            JOptionPane.showMessageDialog(this, "Silmək istədiyiniz sətri seçin");
        }

    }//GEN-LAST:event_btndeleteActionPerformed

    private void btnupdateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnupdateActionPerformed

        String ad = txt1.getText();
        String malmodel = txt2.getText();
        int amount = Integer.parseInt(txt3.getText());
        double purcost = Double.parseDouble(txt4.getText());
        double salescost = Double.parseDouble(txt5.getText());

        int selindex = table1.getSelectedRow();
        if (selindex >= 0) {
            try {
                String message1 = "Dəyişmək istədiyinizdən əminsinizmi?";
                int ret = JOptionPane.showConfirmDialog(this, message1, "Birini seçin", JOptionPane.YES_NO_OPTION);
                if (ret != 1) {
                    DefaultTableModel model = (DefaultTableModel) table1.getModel();
                    int selectedid = Integer.parseInt(model.getValueAt(selindex, 0).toString());
                    String command = "update product_input set PRODUCT_NAME='" + ad + "',PRODUCT_MODEL='" + malmodel + "',"
                            + "PRODUCT_AMOUNT='" + amount + "',PRODUCT_PURCHASE_COST='" + purcost + "',"
                            + "PRODUCT_SALE_COST='" + salescost + "' where idPRODUCT_INPUT='" + selectedid + "'";
                    connect.Execute(command);
                    JOptionPane.showMessageDialog(this, "Məlumat dəyişildi!");
                    goster();
                    connect.ConnectionClose();
                } else {
                    JOptionPane.showMessageDialog(this, "Məlumat dəyişilmədi!");
                }
            } catch (Exception ex) {
                JOptionPane.showMessageDialog(this, "Məlumat dəyişilmədi!" + "Xəta\n" + ex.getMessage());
            }
        } else {
            JOptionPane.showMessageDialog(this, "Dəyişiklik etmək istədiyiniz sətri seçin");
        }
    }//GEN-LAST:event_btnupdateActionPerformed

    private void btnaxtarışActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnaxtarışActionPerformed

        DefaultTableModel model = (DefaultTableModel) table1.getModel();
        String malad = txtsearchad.getText().trim();
        String malmodel = txtsearchmodel.getText().trim();

        if (malad.length() > 0 && malmodel.length() > 0) {
         SearchForNameAndModel(model, malad, malmodel);
        } else if (malad.length() > 0 && malmodel.length() == 0) {
            SearchForName(model, malad);
        } else {
            JOptionPane.showMessageDialog(this, "Axtarmaq istədiyiniz malın adını\n və modelini daxil edin");
        }
    }//GEN-LAST:event_btnaxtarışActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new Mal_Girişi().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnaxtarış;
    private javax.swing.JButton btndelete;
    private javax.swing.JButton btnsave;
    private javax.swing.JButton btnshow;
    private javax.swing.JButton btnupdate;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JTable jTable2;
    private javax.swing.JLabel lblsearchmodel;
    private javax.swing.JLabel lbsearchad;
    private javax.swing.JPanel pnlsearch;
    private javax.swing.JTable table1;
    private javax.swing.JTextField txt1;
    private javax.swing.JTextField txt2;
    private javax.swing.JTextField txt3;
    private javax.swing.JTextField txt4;
    private javax.swing.JTextField txt5;
    private javax.swing.JTextField txtsearchad;
    private javax.swing.JTextField txtsearchmodel;
    // End of variables declaration//GEN-END:variables
}
